﻿using System.Configuration;

namespace Comsenz.Base.Configs
{
    /// <summary>
    /// 链接配置
    /// </summary>
    /// <author>Chiron</author>
    public class ConnectConfig : ConfigurationElement
    {
        /// <summary>
        /// 配置名
        /// </summary>
        [ConfigurationProperty("name", IsKey = true, IsRequired = true)]
        public string Name
        {
            get
            {
                return this["name"] as string;
            }
            set
            {
                this["name"] = value;
            }
        }
        /// <summary>
        /// 链接方式类型
        /// </summary>
        [ConfigurationProperty("type", IsRequired = true, DefaultValue = ConnectType.Post)]
        public ConnectType Type
        {
            get
            {
                return (ConnectType)this["type"];
            }
            set
            {
                this["type"] = value;
            }
        }
        /// <summary>
        /// 应用ID
        /// </summary>
        [ConfigurationProperty("ucAppId")]
        public string AppId
        {
            get
            {
                return this["ucAppId"] as string;
            }
            set
            {
                this["ucAppId"] = value;
            }
        }
        /// <summary>
        /// 通讯密钥
        /// </summary>
        [ConfigurationProperty("connectKey")]
        public string ConnectKey
        {
            get
            {
                return this["connectKey"] as string;
            }
            set
            {
                this["connectKey"] = value;
            }
        }
        /// <summary>
        /// API地址
        /// </summary>
        [ConfigurationProperty("apiUri")]
        public string ApiUri
        {
            get
            {
                return this["apiUri"] as string;
            }
            set
            {
                this["apiUri"] = value;
            }
        }
        /// <summary>
        /// IP地址
        /// </summary>
        [ConfigurationProperty("hostIp")]
        public string HostIp
        {
            get
            {
                return this["hostIp"] as string;
            }
            set
            {
                this["hostIp"] = value;
            }
        }
    }
}
